<template>
    <el-aside width="200px">
        <el-scrollbar>
          <h3 style="text-align: center; color: #fff;">厚溥云课堂管理系统</h3>
          <el-menu
        router
        active-text-color="#ffd04b"
        background-color="#545c64"
        class="el-menu-vertical-demo"
        default-active="2"
        text-color="#fff"
      >
      <template v-for="(item,index) in menus" :key="item.path">
        <el-sub-menu v-if="!item.hidden" :index="item.path">
          <template #title>
            <el-icon>
              <component :is="item.meta.icon"></component>
            </el-icon>
            <!-- <el-icon><location /></el-icon> -->
            <span>{{item.meta.title}}</span>
          </template>
            <el-menu-item v-for="(subItem,index) in item.children" :key="item.path+subItem.path" :index="`${item.path}/${subItem.path}`">{{subItem.meta.title}}</el-menu-item>
          </el-sub-menu>
      </template>

          <!-- <el-sub-menu index="2">
          <template #title>
            <el-icon><document /></el-icon>
            <span>课程管理</span>
          </template>
            <el-menu-item index="2-1">课程列表</el-menu-item>
            <el-menu-item index="2-2">添加课程</el-menu-item>
          </el-sub-menu> -->
  
    
       
      </el-menu>
        </el-scrollbar>
      </el-aside>
</template>
<script setup>
import {useRoute,useRouter} from 'vue-router'
const router = useRouter()
const menus = router.options.routes
</script>